<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{$sites[$siteid]['SITE_NAME']}-{lang('admin')}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="{ADMIN_THEME}v2/css/bootstrap.css" />
<link rel="stylesheet" href="{ADMIN_THEME}v2/css/bootstrap-responsive.css" />
<link rel="stylesheet" href="{ADMIN_THEME}v2/css/style.css" />
<link rel="stylesheet" href="{ADMIN_THEME}v2/css/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="{ADMIN_THEME}images/table_form.css" />
    <link href="{ADMIN_THEME}images/dialog.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{ADMIN_THEME}js/jquery.min.js"></script>
<script type="text/javascript" src="{ADMIN_THEME}js/dialog.js"></script>
<script type="text/javascript">
    $(function(){
        //var is_member_hide = 0;
        if ($('#navigation').height() >= 80) {
            //$("#dr_member").hide();
            //is_member_hide = 1;
            $(".dr_module_menu").remove();
            $("#dr_select_module").show();
        }
        /*
         if ($(window).width() <= 1024) {
         if ($('.main-nav').width() > 600 && is_member_hide == 0) {
         $("#dr_top_nav").hide();
         }
         $("#dr_search_submit").hide();
         } else if ($(window).width() < 1400) {
         if ($('.main-nav').width() > 800 && is_member_hide == 0) {
         $("#dr_top_nav").hide();
         }
         }
         */
        $("#dr_select_site, #dr_select_module").bind({
            'mouseover':function(){
                $(this).addClass("open");
            },
            'mouseout':function(){
                $(this).removeClass("open");
            }
        });
        $("#dr_member").bind({
            'mouseover':function(){
                $(this).addClass("open");
            },
            'mouseout':function(){
                $(this).removeClass("open");
            }
        });
        $('.toggle-nav').click(function(e){
            e.preventDefault();
            hideNav();
        });
        wSize();
        $(".toggle-subnav").click(function (e) {
            e.preventDefault();
            var $el = $(this);
            $el.parents(".subnav").toggleClass("subnav-hidden").find('.subnav-menu,.subnav-content').slideToggle("fast");
            $el.find("i").toggleClass("icon-angle-down").toggleClass("icon-angle-right");

            if($("#left").hasClass("mobile-show") || $("#left").hasClass("sidebar-fixed")){
                getSidebarScrollHeight();
                $("#left").getNiceScroll().resize().show();
            }
        });
                $("#sitelist li").click(function(){
                    var id=$(this).attr('id');

                });
            });
            function getSidebarScrollHeight(){
                var $el = $("#left"),
                        $w = $(window),
                        $nav = $("#navigation");
                var height = $w.height();

                if(($nav.hasClass("navbar-fixed-top") && $w.scrollTop() == 0) || $w.scrollTop() == 0) height -= 40;

                if($el.hasClass("sidebar-fixed") || $el.hasClass("mobile-show")){
                    $el.height(height);
                }
            }
            function hideNav(){
                $("#left").toggle().toggleClass("forced-hide");
                if($("#left").is(":visible")) {
                    $("#main").css("margin-left", $("#left").width());
                } else {
                    $("#main").css("margin-left", 0);
                }

                if($('.dataTable').length > 0){
                    var table = $.fn.dataTable.fnTables(true);
                    if ( table.length > 0 ) {
                        $(table).each(function(){
                            if($(this).hasClass("dataTable-scroller")){
                                $(this).dataTable().fnDraw();
                            }
                        });
                        $(table).dataTable().fnAdjustColumnSizing();
                    }
                }

                if($(".calendar").length > 0){
                    $(".calendar").fullCalendar("render");
                }
            }
            if(!Array.prototype.map)
                Array.prototype.map = function(fn,scope) {
                    var result = [],ri = 0;
                    for (var i = 0,n = this.length; i < n; i++){
                        if(i in this){
                            result[ri++]  = fn.call(scope ,this[i],i,this);
                        }
                    }
                    return result;
                };

            var getWindowSize = function(){
                return ["Height","Width"].map(function(name){
                    return window["inner"+name] ||
                            document.compatMode === "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ]
                });
            }
            window.onload = function (){
                if(!+"\v1" && !document.querySelector) { // for IE6 IE7
                    document.body.onresize = resize;
                } else {
                    window.onresize = resize;
                }
                function resize() {
                    wSize();
                    return false;
                }
            }
            function wSize(){
                var str=getWindowSize();
                var strs= new Array(); //定义一数组
                strs=str.toString().split(","); //字符分割
                var heights = strs[0]-80,Body = $('body');$('#rightMain').height(heights);
            }
            function _M(mid, sid, url, name) {
                $('.main-nav > li, .dropdown-menu > li').removeClass("active");
                $('#_M_'+mid).addClass("active");
                $(".d_menu").hide();
                $("#D_M_"+mid).show();
                _MP(sid, url);
            }
            function _MP(id, url) {
                $("#rightMain").attr('src', url);
                $(".subnav-menu > li").removeClass("dropdown");
                $("#_MP_"+id).addClass("dropdown");
                $("#_MP_"+id).parent().show();
                $("#_MP_"+id).parent().parent().attr('class', 'subnav');
                if (url.indexOf('http') == -1) {
                    dr_loading();
                }
            }
            function _MAP(mid, sid, url) {
                $('.main-nav > li').removeClass("active");
                $('#_M_'+mid).addClass("active");
                $(".d_menu").hide();
                $("#D_M_"+mid).show();
                dr_clear_map();
                _MP(sid, url);
            }
            function logout(){
                if (confirm("{lang('a-com-19')}"))
                    top.location = '{url("admin/login/logout/")}';
                return false;
            }
            function dr_get_map() {
                $("#dr_backdrop").show();
                $("#modal-map").show();
            }
            function dr_clear_map() {
                $("#dr_backdrop").hide();
                $("#modal-map").hide();
            }
</script>
</head>
<body scroll="no" style="overflow:hidden">

<div id="navigation">
    <div class="container-fluid">
        <a href="{SITE_URL}" id="brand" target="_blank">FineCMS</a>
        <a href="javascript:;" class="toggle-nav" rel="tooltip" data-placement="bottom"><i class="icon-reorder"></i></a>
        <ul class="main-nav">
            {loop $menu['top'] $k=>$t}
            <li id="_M_{$k}" class="{if $k==0}active{/if} ">
                <a href="javascript:_M({$k},{$t['select']},'{$t['url']}','{lang($t['name'])}')" hidefocus="true" style="outline:none;"><span>{lang($t['name'])}</span></a></li>
            {/loop}
        </ul>
        <div class="user">
            <ul class="icon-nav" id="dr_top_nav">
                <li class="dropdown">
                    <a class="dropdown-toggle" href="{SITE_URL}" target="_blank" title="{$SITE_NAME}" id="site_homepage"><i class="icon-home"></i></a>
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle" href="{url('admin/index/cache')}" title="{lang('a-men-19')}" target="right"><i class="icon-refresh"></i></a>
                </li>


                <li class="dropdown"><a class="dropdown-toggle" href="{url('admin/index/updatemap')}" target="right"><i class="icon-sitemap"></i></a></li>

                <li class="dropdown"><a class="dropdown-toggle" href="javascript:logout();"><i class="icon-signout"></i></a></li>

                <li class="dropdown" style="margin-left:13px"><a style="width:0px;padding:0px;margin:0" class="dropdown-toggle">&nbsp;</a></li>

                <li class="dropdown"><a class="dropdown-toggle" href="http://www.dayrui.com/free/" target="_blank"><i class="icon-cloud"></i></a></li>
                <li class="dropdown"><a class="dropdown-toggle" href="http://www.dayrui.net/forum.php?mod=forumdisplay&fid=66" target="_blank"><i class="icon-comment"></i></a></li>
                <li class="dropdown"><a class="dropdown-toggle" href="http://www.finecms.net/help/" target="_blank"><i class="icon-book"></i></a></li>

            </ul>
        </div>
    </div>
</div>
<div class="container-fluid" id="content">
    <div id="left">
        {loop $menu['top'] $k=>$t}
        <div class="d_menu" id="D_M_{$k}" {if $k>0}style="display:none"{/if}>
            <?php $_left=0;?>
            {loop $menu['list'][$k] $name=>$n}
            <div class="subnav  {if $_left}subnav-hidden{/if}">
                <div class="subnav-title">
                    <a href="#" class="toggle-subnav"><i class="icon-angle-{if $_left}right{else}down{/if}"></i><span>{lang($name)}</span></a>
                </div>
                <ul class="subnav-menu" style="{if $_left}display:none{/if}">
                {loop $n $id=>$v}
                <?php $_left=1;?>
                <li id="_MP_{$id}" class=""><a {if isset($v['url']) && $v['url']}href="javascript:_MP({$id},'{$v['url']}', '{php echo isset($v['clz']) ? $v['clz'] : 0;}');"{/if} hidefocus="true" style="outline:none;">{if isset($v['sys'])}{$v['name']}{else}{lang($v['name'])}{/if}</a></li>
                {/loop}
                </ul>
            </div>
            {/loop}
        </div>
        {/loop}
    </div>
    <div id="main">
        <iframe name="right" id="rightMain" src="{url('admin/index/main')}" frameborder="false" scrolling="auto" style="border:none; margin-bottom:0px;" width="100%" height="auto" allowtransparency="true"></iframe>
        <div style="background-color:#EEEEEE; height:100px; padding-top:8px; text-align:right; padding-right:10px;margin-top: -5px;">
           成都天睿信息技术有限公司 &copy; 2011-{date('Y')}&nbsp;&nbsp;<strong><a class="fine-cms" href="http://www.dayrui.com/free/" target="_blank">FineCMS轻量版</a></strong>&nbsp;v{CMS_VERSION}

        </div>
    </div>
</div>
<div id="dr_backdrop" class="modal-backdrop in hide"></div>
</body>
</html>